Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long
Declare Function SetActiveWindow Lib "user32" (ByVal hwnd As Long) As Long
Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Declare Function GetActiveWindow Lib "user32" () As Long
'GetSystemFolders
Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nSize As Long, ByVal lpBuffer As String) As Long
Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public DataFile As String
Public Apath As String
Public MyCode() As MCD
Public OldSearches As New Collection
Public Type MCD
EntryName As String
EntryValue As String ' This is the text
SearchTags() As String
EntryInfo As String
EntryPicName As String
End Type
Public Enum SystemDirs
dirWindows = 0
dirSystem = 1
dirTemp = 2
End Enum
Public Sub SetInfo()
DataFile = "Win32Code2001.CDE"
Apath = App.Path
If Right(Apath, 1) <> "\" Then Apath = Apath & "\"
End Sub
Function FileExist(File As String) As Boolean
If Dir(File) <> "" Then
FileExist = True
Else
FileExist = False
End If
End Function
'Public Function SaveFile() As Boolean
'End Function
Public Function OpenFile() As Boolean
On Local Error GoTo XF
Dim CurLine As String, i As Integer, j As Integer
Dim TempVal As Integer, tmpArray() As String, TmpStg As String
If FileExist(Apath & DataFile) = True Then
If GetAttr(Apath & DataFile) = vbReadOnly Then
SetAttr Apath & DataFile, vbNormal
End If
'ReDim MyCode(0)
Close #1
Open Apath & DataFile For Input As #1
Do Until EOF(1)
Line Input #1, CurLine
If Trim(CurLine) <> "" And Left(CurLine, 2) <> "//" Then
If Left(MyTrim(CurLine), 15) = "<entry number>=" Then
ReDim Preserve MyCode(i)
MyCode(i).EntryName = ""
MyCode(i).EntryValue = ""
i = i + 1
ElseIf Left(MyTrim(CurLine), 13) = "<entry name>=" Then